package cn.fresh.xuanyuan.module.product.controller.app.orchard;

import cn.fresh.xuanyuan.framework.common.pojo.CommonResult;
import cn.fresh.xuanyuan.framework.common.pojo.PageParam;
import cn.fresh.xuanyuan.module.product.service.orchard.OrchardService;
import cn.fresh.xuanyuan.module.product.vo.orchard.OrchardVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Tag(name = "用户 APP - 果园接口")
@RestController
@RequestMapping("/product/orchard")
public class AppOrchardController {

    @Resource
    private OrchardService orchardService;

    @GetMapping(value = "/get-orchard-list")
    @Operation(summary = "获得果园列表")
    public CommonResult<List<OrchardVO>> getOrchardList(@ModelAttribute PageParam pageParam) {
        List<OrchardVO> list = orchardService.getOrchardList(pageParam);
        return CommonResult.success(list);
    }
}
